#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int* getConcatenation(int* nums, int numsSize, int* returnSize) {
    int* arr = (int*)malloc(sizeof(int) * (2 * numsSize));
    for (int i = 0; i < numsSize; i++)
    {
        arr[i] = nums[i];
        arr[i + numsSize] = nums[i];
    }
    *returnSize = 2 * numsSize;
    return arr;
}
int main()
{
    int nums[] = { 1,2,3 };
    int numsSize = sizeof(nums) / sizeof(nums[0]);
    int* returnSize=nums;
    int* arr = getConcatenation(nums, numsSize, returnSize);
    if (arr == NULL)
    {
        return 1;
    }
    else
    {
        for (int i = 0; i < 2 * numsSize; i++)
        {
            printf("%d ", arr[i]);
        }
        free(arr);
        arr = NULL;
    }
    return 0;
}